package com.bank.manage.exception;

import com.bank.manage.model.BankCheckRecords;
import org.gavin.core.domain.Status;
import org.gavin.core.exception.BaseException;

/**
 * BankException
 *
 * @author grl
 * @date 2024/4/9
 */
public class BankException extends BaseException {

    private BankCheckRecords records;

    public BankException(String module, Integer code, Object args, String msg,BankCheckRecords records) {
        super(module, code, args, msg);
        this.records = records;
    }

    public static BankException le(String module, Integer code, Object args, String msg) {
        return new BankException(module, code, args, msg,null);
    }

    public static <T extends Status> BankException le(T status, String module, Object args,BankCheckRecords records) {
        return new BankException(module, status.getCode(), args, status.getMsg(),records);
    }

    public static <T extends Status> BankException le(T status,BankCheckRecords records) {
        return new BankException(null, status.getCode(), null, status.getMsg(),records);
    }
    public static <T extends Status> BankException le(T status) {
        return new BankException(null, status.getCode(), null, status.getMsg(),null);
    }

    public BankCheckRecords getRecords() {
        return records;
    }

    public void setRecords(BankCheckRecords records) {
        this.records = records;
    }
}
